package com.lagou.edu.dao;

import com.lagou.edu.pojo.Auth;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CodeDao extends JpaRepository<Auth, Integer> {

    @Query("select o from Auth o where o.email = ?1 and o.code = ?2 order by o.createtime desc")
    List<Auth> findByEmailAndCode(String email, String code);

}
